/**
 */
package de.thwildau.tm.moses.thrift.thrift.impl;

import de.thwildau.tm.moses.thrift.thrift.ContainerType;
import de.thwildau.tm.moses.thrift.thrift.ThriftPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Container Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link de.thwildau.tm.moses.thrift.thrift.impl.ContainerTypeImpl#getCppType <em>Cpp Type</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ContainerTypeImpl extends MinimalEObjectImpl.Container implements ContainerType
{
  /**
   * The default value of the '{@link #getCppType() <em>Cpp Type</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getCppType()
   * @generated
   * @ordered
   */
  protected static final String CPP_TYPE_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getCppType() <em>Cpp Type</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getCppType()
   * @generated
   * @ordered
   */
  protected String cppType = CPP_TYPE_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected ContainerTypeImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return ThriftPackage.Literals.CONTAINER_TYPE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getCppType()
  {
    return cppType;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setCppType(String newCppType)
  {
    String oldCppType = cppType;
    cppType = newCppType;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ThriftPackage.CONTAINER_TYPE__CPP_TYPE, oldCppType, cppType));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case ThriftPackage.CONTAINER_TYPE__CPP_TYPE:
        return getCppType();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case ThriftPackage.CONTAINER_TYPE__CPP_TYPE:
        setCppType((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case ThriftPackage.CONTAINER_TYPE__CPP_TYPE:
        setCppType(CPP_TYPE_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case ThriftPackage.CONTAINER_TYPE__CPP_TYPE:
        return CPP_TYPE_EDEFAULT == null ? cppType != null : !CPP_TYPE_EDEFAULT.equals(cppType);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (cppType: ");
    result.append(cppType);
    result.append(')');
    return result.toString();
  }

} //ContainerTypeImpl
